<template>
   <div style="width: 800px;">
      <editor v-model="notificationForm.content"
      @input="onInput"
      api-key="8jf7rmt3uawauymb695g1m8qtbisdp6t8o76xdzu6szxz3hh" 
      :father_method="appendImageToContentFromEditor">
   </editor>
   </div>
   <!-- <WangEditor :initValue="state.form.content" @getEditorContent="onEditorChange" :father_method="appendImageToContentFromEditor" ></WangEditor> -->
</template>
<script setup>
// 引入
import WangEditor from '@/components/WangEditor.vue'
import {reactive} from 'vue'
import Editor from '@/components/TinymceNew.vue';
const notificationForm = reactive({
    content: '',    
})
const onInput=(val)=> {
   state.form.content=val
   console.log('收到内容改',state.form.content)
}
const onEditorChange = (arr, html) => {
    console.log(arr, html)
}
const state = reactive({
   form:{
      content:'我要输入内容',
      images:[],
    },
})
// 从富文本编辑器的上传图片，获得的图片写入题干数组mages
const appendImageToContentFromEditor=(image)=>{
   if(image!=''){
      state.form.images.push(image)
      console.log("收到图片：",state.form)
   }
}
</script>